package databaseDAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DataAccess {
	public static Connection getConnection() throws ClassNotFoundException{
		Connection con = null;
		String driver = "com.mysql.jdbc.Driver";
		String url = "jdbc:mysql://localhost/rightmanagement?user=root&password=123456&useUnicode=true&characterEncoding=utf8&useSSL=true";
		try{
			Class.forName(driver);

			con = DriverManager.getConnection(url);
			//System.out.println("提交到数据库");
		}catch(SQLException se){
			se.printStackTrace();
		}
		return con;
	}
	
	// test
	public static void main(String[] args) {
//		System.out.println("--------------ce");
//		getConnection();
	}
}
